
import "../scss/products.scss";
import "../swiper/animate.min.css";
import "../css/iconfont/iconfont.css";

import {WOW} from "../swiper/wow.js";


import{getProducts}from "./request.js";

import{lazyLoad}from "../utils/lazyLoad.js";
import{partner} from "./common.js";

new WOW().init()

let Imgs = document.querySelectorAll("header img,main div:not(:last-child) img")

console.log(Imgs); //获取页面9张图片

//调用合作伙伴图片--common里
partner();

async function xixixi(){
  let arr3 = await getProducts();
  console.log(arr3);
  let res3 = [];
  arr3.results.forEach(function(item){
    res3.push(item.photo_detal.url);
  })
  Imgs.forEach(function(item,index){
    item.setAttribute("data-src",res3[index])
  })

  lazyLoad(Imgs);

};
xixixi();




